import os
import sys

from core.rest_client import RestClient
from common.read_data import data

BASE_PATH = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
sys.path.append(BASE_PATH)
data_file_path = os.path.join(BASE_PATH, "config", "setting.ini")
api_root_url = data.load_ini(data_file_path)["host"]["api_root_url"]


class Task(RestClient):

    def __init__(self, api_root_url, **kwargs):
        super(Task, self).__init__(api_root_url, **kwargs)

    def task_status(self, **kwargs):
        '''
        获取任务状态
        '''
        return self.post("/api/task/status", **kwargs)




task = Task(api_root_url)
